#include<bits/stdc++.h>
#define int __int128
#define rep(i,a,b) for(int i(a);i<=(b);++i)
#define req(i,a,b) for(int i(a);i>=(b);--i)
#define sort stable_sort
using namespace std;
char buf[1<<23],*p1=buf,*p2=buf,ubuf[1<<23],*u=ubuf;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
template<typename TP> inline TP read(TP &num)
{
	TP x=0;
	int f=0;
	char ch=getchar();
	while(ch<48||ch>57) f|=ch=='-',ch=getchar();
	while(48<=ch&&ch<=57) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return num=f?-x:x;
}
template<typename ...Args> inline void read(Args &...args)
{
	(read(args),...);
}
template<typename TP> inline void write(TP x)
{
	(x<0)?(putchar('-'),x=-x):0;
	(x>9)?(write(x/10),0):0;
	putchar((x%10)^48);
}
template<typename TP> inline void writeln(TP x)
{
	write<TP>(x);
	puts("");
}
int T,n;
inline int val(int x)
{
	if(x&1) return (1+x)*((x-1)/2+1)/2;
	else return (2+x)*((x-2)/2+1)/2;
}
signed main()
{
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
	read(T);
	while(T--)
	{
		read(n);
		if(!n) {puts("2");continue;}
		int l=1,r=n,ans=-1;
		while(l<=r)
		{
			int mid=l+(r-l)/2;
			if(val(mid)>=n) r=mid-1,ans=mid;
			else l=mid+1;
		}
		writeln(ans+2+(n%2==1&&ans%2==0));
	}
	return 0;
}
